package com.hrd.admin.system;

import com.alibaba.fastjson.JSONObject;
import com.hrd.admin.base.BaseController;
import com.hrd.common.util.bean.ServiceResult;
import com.hrd.service.CustomerService;
import com.hrd.service.OrderService;
import com.hrd.service.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author: wangpeng
 * @Date: 2022/1/12 14:51
 * @Description:
 */
@Controller
@RequestMapping("/system/test")
public class TestController extends BaseController {
    @Autowired
    private WarehouseService warehouseService;
    @Autowired
    private CustomerService customerService;


    @Autowired
    OrderService orderService;

    @ResponseBody
    @RequestMapping("test1")
    public List<JSONObject> getListAction() {
        warehouseService.synchronizationWarehouseInfo();
        return null;
    }


    @ResponseBody
    @RequestMapping("test2")
    public ServiceResult<String> t22() {
        return orderService.syncCollectionOrder();

    }

    @ResponseBody
    @RequestMapping("test3")
    public ServiceResult<String> t333() {
        return orderService.syncSalesOutboundOrder();

    }
    @ResponseBody
    @RequestMapping("test4")
    public ServiceResult<String> t444() {
        customerService.savemysql();
        return new ServiceResult<>();

    }
}
